<h1>{{editType}}用户</h1>
<form name="userForm" novalidate>
    <div class="form-group" show-errors>
        <label class="control-label">编码</label>
        <input type="text" class="form-control" name="code" ng-model="customer.code" placeholder="编码"/>
    </div>
    <div class="form-group" show-errors>
        <label class="control-label">用户名<span class="need">*</span></label>
        <input type="text" class="form-control" ng-disabled="customer.objectId"  name="name" ng-model="customer.username" required placeholder="名称"/>
        <p class="help-block" ng-if="userForm.name.$error.required">必填</p>
    </div>

    <div class="form-group">
        <label class="control-label">密码<span ng-if="!customer.objectId" class="need">*</span></label>
        <input type="password" class="form-control" name="password" ng-model="customer.password" placeholder="密码"/>
    </div>

    <div class="form-group">
        <label class="control-label">姓名(真实)</label>
        <input type="text" class="form-control" name="realName" ng-model="customer.realName" placeholder="姓名"/>
    </div>

    <div class="form-group">
        <label class="control-label">手机</label>
        <input type="text" class="form-control" name="mobilePhoneNumber" ng-model="customer.mobilePhoneNumber" placeholder="手机号码"/>

    </div>

    <div class="form-group">
        <label class="control-label">邮箱</label>
        <input type="text" class="form-control" name="email" ng-model="customer.email" placeholder="email"/>
        <!--<p class="help-block" ng-if="userForm.email.$error.required">必填</p>-->
    </div>

    <div class="form-group">
        <label class="control-label">地址</label>
        <input type="text" class="form-control" name="address" ng-model="customer.address" placeholder="地址"/>
    </div>

    <div class="form-group">
        <label class="control-label">分组</label>
        <select  class="form-control" ng-model="customer.group">
            <option value="" ng-selected="!customer.group">不选</option>
            <option ng-repeat="g in groups" value="{{g.objectId}}" ng-selected="customer.group == g.objectId">{{g.name}}</option>
        </select>
    </div>


    <div ng-show="customer.objectId" class="form-group">
        <label class="control-label">积分:</label>
        <span>{{customer.orderAmount}}</span>
        <label class="control-label">积分分组:</label>
        <span>{{groupName}}</span>
    </div>



    <div class="form-group">
        <label class="control-label">备注</label>
        <textarea row="3" type="text" class="form-control" name="remark" ng-model="customer.remark" placeholder="备注">
        </textarea>
    </div>






    <div class="mt20 fix">
        <button class="btn btn-primary" ng-click="save()">保存</button>
        <button class="btn btn-link" ng-click="reset()">重置</button>
    </div>

</form>